UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+yNXR+0WFzictMiJ8YKqO5Ib4oEr4UODpAbAPBFd07s=' 
WHERE 
  key_id = '3a5b46c22b108f46a3ea2b93a832097c4b5cba8928cb927b211e5f065d2b035f' 
  AND (
    token = '+yNXR+0WFzictMiJ8YKqO5Ib4oEr4UODpAbAPBFd07s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027