UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oW11YsJ19mjDcEJFTmjSZ6X31vAHCjApWOulzc6P5Mc=' 
WHERE 
  key_id = '5fc1d95285a73d5a960673f5b96edc26628a1d0a1bbdb0edf3c1a0312f6a6846' 
  AND (
    token = 'oW11YsJ19mjDcEJFTmjSZ6X31vAHCjApWOulzc6P5Mc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044