UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '281JeQCMfuae8KwFPQEZjoBEU+Z6+PNyi7h+0td7ceY=' 
WHERE 
  key_id = 'caca136bdee847407e28f94577aface6abbb487efece831b092504facc67b7a0' 
  AND (
    token = '281JeQCMfuae8KwFPQEZjoBEU+Z6+PNyi7h+0td7ceY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056