UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JCLPf2GW1kubZzW/y6fFlybuXmGep1tzEpw2nXioYTw=' 
WHERE 
  key_id = '688cddee4c87b95855c4e99052d6421caaeea12a3c490637166f64b16b9a3a00' 
  AND (
    token = 'JCLPf2GW1kubZzW/y6fFlybuXmGep1tzEpw2nXioYTw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038