UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Y77PAY/fEOR7Ebx7znRQ+XYb1zU0cMsPL3gOJXU48Qw=' 
WHERE 
  key_id = 'f008bfea0fe4ed346dcc0d4bf0b8ccb54e84814f0508d3e2b1cb6113cc4bcab1' 
  AND (
    token = 'Y77PAY/fEOR7Ebx7znRQ+XYb1zU0cMsPL3gOJXU48Qw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031