UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v6AUJFRMizqwX5k0yhD3PKKyW/cqxBKJJ8OAxufRd6g=' 
WHERE 
  key_id = 'cc0921a92bdcec1e2371c66827100b59bda98f151827ea7bbbd083d61c368e62' 
  AND (
    token = 'v6AUJFRMizqwX5k0yhD3PKKyW/cqxBKJJ8OAxufRd6g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019