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

Query time 0.00023