UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TM2wM1x2LXMEgnfSLvHAuhsarTM6yVWLxodvxuLHe/o=' 
WHERE 
  key_id = 'ee65449811bef07b2f1a8be8ff244ed96a696ed5aafc5a1dd7cfaa5869699a57' 
  AND (
    token = 'TM2wM1x2LXMEgnfSLvHAuhsarTM6yVWLxodvxuLHe/o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024