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

Query time 0.00052