UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/F+RuHLsoc7sKZ0OV8Q1a+XEPG+Cccix2xRxQwO3gKk=' 
WHERE 
  key_id = '2e1474b20271cf1df2e509da6f9c7d6e8a8f441ee1e213f3276affa680854f23' 
  AND (
    token = '/F+RuHLsoc7sKZ0OV8Q1a+XEPG+Cccix2xRxQwO3gKk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031