UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GjmLi4hNKnbm/Khr7z3FuCnVg3S7PhMpbrJsNSSpND0=' 
WHERE 
  key_id = '673ae1a54dabe2f7da2b8cdc1a990a3e398a8f8dcb2536c052b0424057fa7702' 
  AND (
    token = 'GjmLi4hNKnbm/Khr7z3FuCnVg3S7PhMpbrJsNSSpND0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029