UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q8hQcaBtujVuAvGtPKDnzqJNUegZJBOMTgD4TfGngBk=' 
WHERE 
  key_id = 'be56fc572f71cbb692d4bc6997d802c1853da076c569c39ff7fa7e4b91baf20a' 
  AND (
    token = 'q8hQcaBtujVuAvGtPKDnzqJNUegZJBOMTgD4TfGngBk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020