UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '73plZjU4CqVyC2oJXryhuLvQf+JRkqxVe/ScNqgE/4E=' 
WHERE 
  key_id = '7eb2d6f96cf3404d2f144337a706f1bf870bf4842f42b80f25a9b61f0bd0c64f' 
  AND (
    token = '73plZjU4CqVyC2oJXryhuLvQf+JRkqxVe/ScNqgE/4E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025