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

Query time 0.00025