UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8WoznYHLGF4B72xTmZoCJoOyPaSoQq9qpKLjHQBis/4=' 
WHERE 
  key_id = '59907d5cd230b055e77e2b801e9722da0a87d0c0e7fe4d28bbff11840cb02cf3' 
  AND (
    token = '8WoznYHLGF4B72xTmZoCJoOyPaSoQq9qpKLjHQBis/4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019