UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hEIAeNqShnPBqAcVYc0pYaLVztnfR16mGxU/J/5GIz8=' 
WHERE 
  key_id = 'f76b38bb31aebd8a42fba05b45c9000016e174ab70dbad5e08b620cb5a89901f' 
  AND (
    token = 'hEIAeNqShnPBqAcVYc0pYaLVztnfR16mGxU/J/5GIz8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029