UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vLh35h6lHHHuObCLhtlT2hJwze/VJdLiKeIExgZmiGk=' 
WHERE 
  key_id = '1ffb0b46dd51c57300de606f46a4521d2af2bf00a2478884a149b0572dfe8771' 
  AND (
    token = 'vLh35h6lHHHuObCLhtlT2hJwze/VJdLiKeIExgZmiGk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016