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

Query time 0.00027