UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3vJQqW0HVH46uIk2WhGFUOBFHgTGRzBisxynj3cdOl8=' 
WHERE 
  key_id = '072b8679abb6809639560ef67b38040b7c8a7e335d051da7ff22bb2c98d963c0' 
  AND (
    token = '3vJQqW0HVH46uIk2WhGFUOBFHgTGRzBisxynj3cdOl8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040