UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mu0cxugvoQiw6NFqoHLjig0/00aQAEVXyLmDYnMZPCY=' 
WHERE 
  key_id = '38108f77d671eb9f6948c596ad9420257f27d56dd74e43f6621ab06d64cc28bc' 
  AND (
    token = 'mu0cxugvoQiw6NFqoHLjig0/00aQAEVXyLmDYnMZPCY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032