UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YRc77PDuSjnMYrDHzUI20mnKXiUX5STE5yH6BVWdkzU=' 
WHERE 
  key_id = '07491dc57b648d6b45cea4c26af96026fbb4b2af26d07282bcd1c6b7b98a3975' 
  AND (
    token = 'YRc77PDuSjnMYrDHzUI20mnKXiUX5STE5yH6BVWdkzU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00144