UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pz7eTRRtG598Ymb2/ls7T3bAfa3u5OXu/5zsnR9Tyh8=' 
WHERE 
  key_id = '6a79397282d0ae5387cb9d29ba11e8773ecb56038bf0e4563721c7acbb598de1' 
  AND (
    token = 'pz7eTRRtG598Ymb2/ls7T3bAfa3u5OXu/5zsnR9Tyh8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024