UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fYVmMEOkVfvd5k4FzHFtRq0d0FQabp0xMDd4l/G1Kgo=' 
WHERE 
  key_id = '98405a15ee15fb8ea1658fc12736507c5686d8fcb2352d9e4a25e65235d43b8d' 
  AND (
    token = 'fYVmMEOkVfvd5k4FzHFtRq0d0FQabp0xMDd4l/G1Kgo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036