UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6/5A0t/S8l0710mWV7OK7ANzHG8/y0yWpfQd6ktHJHs=' 
WHERE 
  key_id = '4223313c4108fb48e5b83847b0f2e601d90c0cfa0bddc17a10a5743da7f17518' 
  AND (
    token = '6/5A0t/S8l0710mWV7OK7ANzHG8/y0yWpfQd6ktHJHs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029