UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '22qKQMAkno1AFYECHRVhU+5gAvSBHnJzkvKEz2nqlAs=' 
WHERE 
  key_id = '4956a693332b682b09e6437d4f69e66974716ce94bdea510a44efd389aa786ba' 
  AND (
    token = '22qKQMAkno1AFYECHRVhU+5gAvSBHnJzkvKEz2nqlAs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037