UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'g45g1/xao83T4du59CmiEZz+RbMWWGEAnKHqNTmaBq0=' 
WHERE 
  key_id = 'cec006993c8822290ef5efbbdf91a12616fb11a2b8f9fff2ff5be6be17094e3c' 
  AND (
    token = 'g45g1/xao83T4du59CmiEZz+RbMWWGEAnKHqNTmaBq0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040