UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Tsrw7mS+rmEhfPP0gDVniLRHuU8fGqAXWmcGV6AZxWo=' 
WHERE 
  key_id = '8ba6537b2a83ae55e77c27247e0fab8898b6a40b52f74eec9a45fba27f3f5c50' 
  AND (
    token = 'Tsrw7mS+rmEhfPP0gDVniLRHuU8fGqAXWmcGV6AZxWo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027