UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1Ypl5+f62pCZAW+mzU/Nj1xQ4MKJreqwgByYZtLdYQE=' 
WHERE 
  key_id = '3075dc2322727a4d05daabac6a3e63c9a3eebcd9674564a03ec8a4c32c9024fb' 
  AND (
    token = '1Ypl5+f62pCZAW+mzU/Nj1xQ4MKJreqwgByYZtLdYQE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023