UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FxtgGDLMHAV9URmHlF5Nq6ahMHIcaXtn8K8Teb5K9Wk=' 
WHERE 
  key_id = 'bf00da064ea911937d4c1b1ec54207de0d8c55fce4e4c8bfd9e085ff02657897' 
  AND (
    token = 'FxtgGDLMHAV9URmHlF5Nq6ahMHIcaXtn8K8Teb5K9Wk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027